<?php
/**
 * CreateTime: 2023/7/24 16:26
 */

namespace App\Scopes;

use App\Func\ScopeFunc\AuthScopeStaffFunc;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;

class MediationStaffUserScope  implements Scope
{
    public function apply(Builder $builder, Model $model)
    {
        // 客户端使用根据用户id过滤
        $staffIds = AuthScopeStaffFunc::getDepartmentStaffByCurrentStaffId();
        $builder->whereIn('staff_id', $staffIds);
    }


}